# -*- coding: utf-8 -*-
from sqlalchemy import Column,String,Integer,Text,Binary,Boolean,DateTime,Enum,Float
from adminApp.extensions import db
from .base import BaseModel


class Idc(BaseModel, db.Model):
    '''机房'''
    name = Column(String(64))   # 机房名称
    mark = Column(String(128))  # 分段标识
    address = Column(String(128))              # 所在地地址
    # 备注
    remark = Column(Text)

    machines = db.relationship("Machine", back_populates="idc", lazy='dynamic')

    def __str__(self):
        return '<机房:{}-{}>'.format(self.name, self.mark)